﻿@model CNRegex.Web.Models.ModelTutorialTemplateTutorialContent
<link href="@Url.Content("~/Content/css/TutorialTemplate_Comment.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Scripts/syntaxhighlighter/shCore.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Scripts/syntaxhighlighter/shThemeDefault.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/syntaxhighlighter/shCore.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/syntaxhighlighter/shBrushCSharp.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kindeditor/kindeditor-min.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/common.js")" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function () {
		registerKindeditor("Comment");
		SyntaxHighlighter.all()
	}
	);
</script>
<div class="ttc_comments">
	<h2 class="t_h2">讨论:</h2>
	@using (Html.BeginForm(Model.CommentActionName, Model.CommentControllerName, new { id = Model.CurrentCatalogID}))
 {
	 if (CNRegex.Web.Base.FrontContext.CurrentRegexUser == null)
	 {
				<div class="ttc_comment_account">请您先 <a href="/account/login">登录</a>,如果您没有帐号,请先 <a href="/account/register">注册</a></div>
	 }
	 else
	 {
				<div>
					@Html.TextArea("Comment", new { style="height:150px;"})
				</div>
				@Html.Hidden("TutorialCatalogContentID", Model.CurrentTutorialCatalogContent.ID)
				<input type="submit" value="发表讨论" class="ttc_submit" />
	 }
 }
 <ul>
		@for (int i = 0; i < Model.CurrentTutorialCatalogContentComments.Count(); i++)
		{
			<li>
				<span class="ttc_comment_serial">@(i+1)</span>
				<a href="/@Model.CurrentTutorialCatalogContentComments[i].RegexUserName">@Model.CurrentTutorialCatalogContentComments[i].RegexUserName</a>
				<span class="ttc_comment_date">发表于 : @Model.CurrentTutorialCatalogContentComments[i].CommentDate.ToString("yyyy-MM-dd hh:mm:ss")</span>
				<div class="ttc_comment_content">
					@(new HtmlString(Model.CurrentTutorialCatalogContentComments[i].Comment))
				</div>
				
			</li>
		}
	</ul>
	@{
		Html.RenderPartial("/Views/Controls/Paginate.cshtml",Model.Paginate);
	}
</div>